﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ESPlus.Core;
using ESPlus.Application.Basic.Passive;
using ESPlus.Application.Group.Passive;
using ESBasic.ObjectManagement;
using ESPlus.Core.Passive;
using ESPlus.Application.Chat.Passive;
using ESPlus.Rapid;

/*
 * 本demo采用的是ESFramework的免费版本，不需要再次授权、也没有使用期限限制。若想获取ESFramework其它版本，请联系 sky.zhuwei@163.com
 * 
 */
namespace ESFDemo
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                RapidPassiveEngine rapidPassiveEngine = new RapidPassiveEngine();
                LoginForm loginForm = new LoginForm();
                if (loginForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                MainForm mainForm = new MainForm();
                rapidPassiveEngine.Initialize(loginForm.UserID, "127.0.0.1", 9018, mainForm, mainForm);
                mainForm.Initialize(loginForm.UserID, rapidPassiveEngine);
                Application.Run(mainForm);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
    }
}
